﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="ChangeProfile.aspx.cs" Inherits="_Default" %>

<%@ Register assembly="DevExpress.Web.v11.2, Version=11.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxDocking" tagprefix="dx" %>

<%@ Register assembly="DevExpress.Web.v11.2, Version=11.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dx" %>

<%@ Register assembly="DevExpress.Web.ASPxEditors.v11.2, Version=11.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<%@ Register Src="~/Pages/changeProfile.ascx" TagName="changeProfile" TagPrefix="widget" %>

<%@ Register Src="~/Pages/Menu.ascx" TagName="Menu" TagPrefix="widget" %>

<%@ Register Src="~/Pages/Login.ascx" TagName="Login" TagPrefix="widget" %>

<%@ Register Src="~/Pages/Time.ascx" TagName="Time" TagPrefix="widget" %>


<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <script type="text/javascript">
    // <![CDATA[
                                 function ShowWidgetPanel(widgetPanelUID) {
                                     var panel = dockManager.GetPanelByUID(widgetPanelUID);
                                     panel.Show();                                     
                                 }
                                 function SetWidgetButtonVisible(widgetName, visible) {
                                     var button = ASPxClientControl.GetControlCollection().GetByName('widgetButton_' + widgetName);
                                     button.GetMainElement().className = visible ? '' : 'disabled';
                                 }
     // ]]> 
    </script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent" >
    <div>
        <dx:ASPxDockManager ID="ASPxDockManager1" runat="server" ClientInstanceName="dockManager">
            <ClientSideEvents
            PanelShown="function(s, e) { SetWidgetButtonVisible(e.panel.panelUID, false) }"
            PanelCloseUp="function(s, e) { SetWidgetButtonVisible(e.panel.panelUID, true) }"/>
        </dx:ASPxDockManager>

        <dx:ASPxDockPanel ID="MenuPanel" runat="server" HeaderText="Menu" 
            PanelUID="Menu" EnableHotTrack="False" 
            OwnerZoneUID="left">
            <Images SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                <LoadingPanel Url="~/App_Themes/DevEx/Web/Loading.gif">
                </LoadingPanel>
            </Images>
            <Styles CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                <LoadingPanel ImageSpacing="5px">
                </LoadingPanel>
            </Styles>
            <ContentCollection>
                <dx:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True">
                    <widget:Menu runat="server" ID="MenuWidget" />
                </dx:PopupControlContentControl>
            </ContentCollection>
        </dx:ASPxDockPanel>

        <dx:ASPxDockPanel ID="LoginPanel" runat="server" HeaderText="Login" 
            PanelUID="Login" EnableHotTrack="False" 
            OwnerZoneUID="left" VisibleIndex="1">
            <Images SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                <LoadingPanel Url="~/App_Themes/DevEx/Web/Loading.gif">
                </LoadingPanel>
            </Images>
            <Styles CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                <LoadingPanel ImageSpacing="5px">
                </LoadingPanel>
            </Styles>
            <ContentCollection>
                <dx:PopupControlContentControl ID="PopupControlContentControl2" runat="server" SupportsDisabledAttribute="True">
                    <widget:Login runat="server" ID="Login" /> 
                </dx:PopupControlContentControl>
            </ContentCollection>
        </dx:ASPxDockPanel>

        <dx:ASPxDockPanel ID="TimePanel" runat="server" HeaderText="Time" 
            PanelUID="Time" EnableHotTrack="False" 
            OwnerZoneUID="left" Height="100%" VisibleIndex="3">
            <Images SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                <LoadingPanel Url="~/App_Themes/DevEx/Web/Loading.gif">
                </LoadingPanel>
            </Images>
            <Styles CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                <LoadingPanel ImageSpacing="5px">
                </LoadingPanel>
            </Styles>
            <ContentCollection>
                <dx:PopupControlContentControl ID="PopupControlContentControl3" runat="server" SupportsDisabledAttribute="True">
                    <widget:Time ID="Time" runat="server" />
                </dx:PopupControlContentControl>
            </ContentCollection>
        </dx:ASPxDockPanel>

        <dx:ASPxDockPanel ID="MainPanel" runat="server" HeaderText="Change Profile" 
            Height="325px" PanelUID="Main" Width="618px" EnableHotTrack="False" 
            OwnerZoneUID="right" MaxHeight="400px" MinHeight="325px">
            <Images SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                <LoadingPanel Url="~/App_Themes/DevEx/Web/Loading.gif">
                </LoadingPanel>
            </Images>
            <Styles CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                <LoadingPanel ImageSpacing="5px">
                </LoadingPanel>
            </Styles>
            <ContentCollection>
                <dx:PopupControlContentControl ID="PopupControlContentControl4" runat="server" SupportsDisabledAttribute="True">
                    <widget:changeProfile ID="ChangeProfile" runat="server" />
                </dx:PopupControlContentControl>
            </ContentCollection>
        </dx:ASPxDockPanel>
    </div>  
    <div class="widgetPanel">
        <asp:Repeater runat="server" ID="repeater" >
            <ItemTemplate>
                <dx:ASPxImage runat="server" ImageUrl='<%# string.Format("~/Images/{0}.png", Container.DataItem) %>' Cursor="pointer"
                    ClientInstanceName='<%# "widgetButton_" + Container.DataItem %>' ToolTip='<%# "Show " + Container.DataItem %>'
                    ClientSideEvents-Click='<%# GetClientButtonClickHandler(Container) %>'>
                </dx:ASPxImage>
            </ItemTemplate>
        </asp:Repeater>
    </div>

    <div> 
        <dx:ASPxDockZone ID="left" runat="server" Width="250px" CssClass="rightZone" 
            PanelSpacing="3px">
        </dx:ASPxDockZone>

        <dx:ASPxDockZone ID="right" runat="server" Width="665px" CssClass="leftZone" 
            PanelSpacing="3px">
        </dx:ASPxDockZone>   
    </div>   
</asp:Content>
